﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace BTM_Client_Application.RealTimeFilter
{
    /// <summary>
    /// Используя этот интерфейс можно создать RealTimeFilter для определенного класса 
    /// просто передав экземпляр класса в конструктор фильтра.
    /// </summary>
    public interface IRealTimeFilterObject
    {
        Dictionary<string, FilterElementInitializer> FilterInterface { get; }
        Dictionary<string, object> FilterElements { get; } 
    }

    public class DataGridColumnInitializer
    {
        public DataGridColumnInitializer(string columnHeader, string columnBinding, int? columnWidth = null)
        {
            Header = columnHeader;
            Binding = columnBinding;
            Width = columnWidth;
        }
        public string Header { get; private set; }
        public string Binding { get; private set; }
        public int? Width { get; private set; }
    }

    public class FilterElementInitializer
    {
        public FilterElementInitializer(FilterElementType elementType, List<Object> elementsVariant = null, DataGridColumnInitializer columnInitializer = null)
        {
            ElementType = elementType;
            ElementVariants = elementsVariant;
            ColumnInitializer = columnInitializer;
        }
        /// <summary>
        /// Тип данных.
        /// </summary>
        public FilterElementType ElementType { get; private set; }
        /// <summary>
        /// Возвожные варианты.
        /// </summary>
        public List<Object> ElementVariants { get; set; }
        /// <summary>
        /// Информация для создания столбца.
        /// </summary>
        public DataGridColumnInitializer ColumnInitializer { get; set; }
    }

    public enum FilterElementType
    {
        StringListContains,
        StringList,
        StringContains,
        StartTime,
        EndTime,
        StartAndEndTime,
        NoControl,
        Other
    }

    
}
